package com.lfnyxy.eenum;

import com.lfnyxy.common.cnst.AppString;

/**
 * Created by ted on 17/9/11.
 * 操作结果通用类。定义所有可能出现的异常结果。
 */
public enum ApplicationStatus {
    NEW_APPLY(1, "新申请"),
    ACCEPT_APPLY(2, "接受申请,等待验收材料上传。"),
    REFUSE_APPLY(3, "拒绝申请"),
    ACCEPT_TRIAL(4, "初审通过"),
    REFUSE_TRIAL(5, "初审拒绝"),
    ACCEPT_EXPERT(6, "专家评审通过"),
    REFUSE_EXPERT(7, "专家评审拒绝"),
    ACCEPT_RESULT(8, "结果确认通过"),
    REFUSE_RESULT(9, "结果确认拒绝"),
    ACCEPT_APPROVAL(10, "审批通过"),
    REFUSE_APPROVAL(11, "审批拒绝"),
    MARIAL_UP(12, "验收材料已上传，等待初审。"),
    UNKNOW(-999, AppString.UnKnow);

    ApplicationStatus(int code, String content) {
        this.code = code;
        this.content = content;
    }

    private int code;
    private String content;

    public int getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }

    public static ApplicationStatus valueOf(int code){
        for(ApplicationStatus item: values()){
            if(item.getCode() == code){
                return item;
            }
        }
        return UNKNOW;
    }
}
